package com.eshop.controller;

import com.eshop.pojo.Menu;
import com.eshop.pojo.MenuRole;
import com.eshop.service.MenuService;
import com.eshop.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 前端控制器
 */
@Api(tags = "后台菜单管理相关")
@RestController
public class MenuController {


    @Autowired
    MenuService menuService;

    @ApiOperation(value = "通过用户id查询菜单列表")
    @GetMapping("/menu")
    public List<Menu> getMenusByUserId(){ return menuService.getMenusByUserId();}
}
